<template>
  <a-row type="flex" :gutter="16">
    <a-col :md="5" :sm="24">
      <TableListLeft  @tableValue="tableValue" v-model="currentOrgCode"/>
    </a-col>
    <a-col :md="5" :sm="24">
      <RuleType ref="childRuleType" @event1="change($event)"></RuleType>
    </a-col>
    <a-col :md="24-10" :sm="24" v-if="this.ruleData == 2">
      <RelevancePage @renovateTbleList="renovateTbleList" ref="relevancePage" :tableName = 'tableName' :columnName = 'columnName' :ruleData = 'ruleData' :title = 'title'></RelevancePage>
    </a-col>
    <a-col :md="24-10" :sm="24"v-if="this.ruleData == 1">
      <NonNullPage @renovateTbleList="renovateTbleList" :tableName = 'tableName' :columnName = 'columnName' :ruleData = 'ruleData' :title = 'title'></NonNullPage>
    </a-col>
    <a-col :md="24-10" :sm="24"v-if="this.ruleData == 3">
      <ComparativeVerificationPage @renovateTbleList="renovateTbleList" :tableName = 'tableName' :columnName = 'columnName' :ruleData = 'ruleData' :title = 'title'></ComparativeVerificationPage>
    </a-col>
    <a-col :md="24-10" :sm="24"v-if="this.ruleData == 4">
      <ConsiformanceVerificationPage @renovateTbleList="renovateTbleList" :tableName = 'tableName' :columnName = 'columnName' :ruleData = 'ruleData' :title = 'title'></ConsiformanceVerificationPage>
    </a-col>
    <a-col :md="24-10" :sm="24"v-if="this.ruleData == 5">
      <BusinessLogicVerificationPage @renovateTbleList="renovateTbleList" :tableName = 'tableName' :columnName = 'columnName' :ruleData = 'ruleData' :title = 'title'></BusinessLogicVerificationPage>
    </a-col>
    <a-col :md="24-10" :sm="24"v-if="this.ruleData == 6">
      <AssociationVerificationPage @renovateTbleList="renovateTbleList" :tableName = 'tableName' :columnName = 'columnName' :ruleData = 'ruleData' :title = 'title'></AssociationVerificationPage>
    </a-col>
    <a-col :md="24-10" :sm="24"v-if="this.ruleData == 7">
      <SpecialEncodingPage @renovateTbleList="renovateTbleList" :tableName = 'tableName' :columnName = 'columnName' :ruleData = 'ruleData' :title = 'title'></SpecialEncodingPage>
    </a-col>
    <a-col :md="24-10" :sm="24"v-if="this.ruleData == 8">
      <ScopePage @renovateTbleList="renovateTbleList" :tableName = 'tableName' :columnName = 'columnName' :ruleData = 'ruleData' :title = 'title'></ScopePage>
    </a-col>




    <a-col  :md="24-10" :sm="24" v-if="this.ruleData == ''">
      <a-card   style="height: 100%;" >
        <a-empty >
          <span slot="description"> 请先选择一个规则! </span>
        </a-empty>
      </a-card>
    </a-col>
    <a-col :md="24" :sm="24">
        <LlbbReportRuleList ref="TableList"></LlbbReportRuleList>
    </a-col>
  </a-row>
</template>

<script>
  import TableListLeft from './TableListLeft.vue'
  import RuleType from './RuleType.vue'
  import NonNullPage from './modules/NonNullPage.vue'
  import RelevancePage from './modules/RelevancePage.vue'
  import ScopePage from './modules/ScopePage.vue'
  import SpecialEncodingPage from './modules/SpecialEncodingPage.vue'
  import AssociationVerificationPage from './modules/AssociationVerificationPage.vue'
  import BusinessLogicVerificationPage from  './modules/BusinessLogicVerificationPage'
  import ConsiformanceVerificationPage from  './modules/ConsiformanceVerificationPage'
  import ComparativeVerificationPage from './modules/ComparativeVerificationPage'
  import  LlbbReportRuleList from './modules/LlbbReportRuleList'
  export default {
    name: 'RuleConfig',
    components: { TableListLeft,RuleType,NonNullPage,RelevancePage,LlbbReportRuleList,ScopePage,SpecialEncodingPage
    ,AssociationVerificationPage,BusinessLogicVerificationPage,ConsiformanceVerificationPage,ComparativeVerificationPage},
    data() {
      return {
        ruleData: '',
        tableName: "",
        columnName: "",
        title: '',
        description: '规则配置页面',
        currentOrgCode: ''
      }
    },
   /*watch: {
      tableName:'change'
    },*/
    methods: {
      change(data) {
        this.ruleData = data;
      },
      tableValue(tableName,columnName,title){
        this.title = title;
        if(tableName=="" ||tableName == undefined|| columnName == "" || columnName == undefined){
          this.ruleData = ''
          this.$refs.childRuleType.clear();
        }
          this.tableName = tableName;
          this.columnName = columnName;
        this.$refs.relevancePage.queryTreeDataBytableName(this.tableName)

      },
      renovateTbleList(){
        this.$refs.TableList.renovate();
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>